package Day11;

import java.io.File;

public class Text3 {

    public static void main(String[] args) {
       /* StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder(2020);
        StringBuilder sb3 = new StringBuilder("超哟几个i选哪个");
        */

        /*File f1 = new File("E:\\a\\b\\a.txt");
       String absPath = f1.getAbsolutePath();
        System.out.println(absPath);
        System.out.println(f1.getName());

        File f2 =  new File("a.txt");
        System.out.println(f2.getAbsolutePath());//获取文件的绝对路径
        System.out.println(f2.getPath());*/

        File file = new File("E:\\a\\a.txt");
        System.out.println(file.isDirectory());//是文件夹，还是文件
        System.out.println(file.getAbsolutePath());
        System.out.println(file.isFile());
        System.out.println(file.exists());


        System.out.println("----------------------------");
        File file2 = new File("E:\\a\\b");
        System.out.println(file2.isDirectory());//是文件夹(true)，还是文件(false)
        System.out.println(file2.getAbsolutePath());
        System.out.println(file2.isFile());
        System.out.println(file2.exists());

        File f7 = new File("E:\\a\\a.txt");
        String name1 = f7.getName();
        System.out.println(name1);

        File f8 = new File("E:\\a\\b");
        String name2 = f8.getName();
        System.out.println(name2);

        System.out.println("====================");

        File f9 = new File("E:\\a\\a.txt");
        long time = f9.lastModified();
        System.out.println(time);

    }
}
